import request from '@/utils/request'

// 优惠券列表
export function apiCouponList(params) {
    return request({
        url: '/cmsCoupon/list',
        method: 'get',
        params
    })
}

// 优惠券详情
export function apiCouponDetail(params) {
    return request({
        url: '/cmsCoupon/' + params,
        method: 'get'
    })
}

// 新增优惠券
export function apiCouponAdd(data) {
    return request({
        url: '/cmsCoupon',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 编辑优惠券
export function apiCouponEdit(params, data) {
    return request({
        url: '/cmsCoupon/' + params,
        method: 'put',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 修改优惠券状态
export function apiCouponStatus(params, data) {
    return request({
        url: '/cmsCoupon/updateStatus/' + params,
        method: 'post',
        params: data
    })
}